/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hatapps.pollafutbolera.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ivan
 */
@Entity
@Table(name = "goles")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Goles.findAll", query = "SELECT g FROM Goles g"),
    @NamedQuery(name = "Goles.findByIdGoles", query = "SELECT g FROM Goles g WHERE g.idGoles = :idGoles"),
    @NamedQuery(name = "Goles.findByLocal", query = "SELECT g FROM Goles g WHERE g.local = :local"),
    @NamedQuery(name = "Goles.findByMinuto", query = "SELECT g FROM Goles g WHERE g.minuto = :minuto"),
    @NamedQuery(name = "Goles.findByGoleador", query = "SELECT g FROM Goles g WHERE g.goleador = :goleador")})
public class Goles implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idGoles")
    private Integer idGoles;
    @Column(name = "local")
    private Boolean local;
    @Column(name = "minuto")
    private String minuto;
    @Column(name = "goleador")
    private String goleador;
    @JoinColumn(name = "idFecha", referencedColumnName = "idFecha")
    @ManyToOne(optional = false)
    private Fecha idFecha;

    public Goles() {
    }

    public Goles(Integer idGoles) {
        this.idGoles = idGoles;
    }

    public Integer getIdGoles() {
        return idGoles;
    }

    public void setIdGoles(Integer idGoles) {
        this.idGoles = idGoles;
    }

    public Boolean getLocal() {
        return local;
    }

    public void setLocal(Boolean local) {
        this.local = local;
    }

    public String getMinuto() {
        return minuto;
    }

    public void setMinuto(String minuto) {
        this.minuto = minuto;
    }

    public String getGoleador() {
        return goleador;
    }

    public void setGoleador(String goleador) {
        this.goleador = goleador;
    }

    public Fecha getIdFecha() {
        return idFecha;
    }

    public void setIdFecha(Fecha idFecha) {
        this.idFecha = idFecha;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idGoles != null ? idGoles.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Goles)) {
            return false;
        }
        Goles other = (Goles) object;
        if ((this.idGoles == null && other.idGoles != null) || (this.idGoles != null && !this.idGoles.equals(other.idGoles))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hatapps.pollafutbolera.entity.Goles[ idGoles=" + idGoles + " ]";
    }
    
}
